<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="top.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/table.css">
<style type="text/css">
body {background: #c4d3f6;}
form p{margin: 10px 5px;}
</style>
<title></title>
</head>
<body>
<!-- 避免内容被吸顶灯效果遮住 -->
<div class="empty" style="margin-top:50px;"></div>
<form action="toUpdateUser.do" method="post" name="info">
	<h2>${user.username } 的个人信息</h2>
	<hr>
	<p>账号：${user.uid }</p>
	<P class="username" uname="${user.username }">用户名： ${user.username }</P>
	<p>性别：${user.sex }</p>
	<p>地址： ${user.addr }</p>
	<p>联系方式： ${user.phone }</p>
	<p>账户余额： ${user.balance }元</p>
	<input type='hidden' name="uid" value="${user.uid}"/>
    <a href='javascript:document.info.submit();' style="display: block;border: 1px solid aliceblue;margin: 4px 0;padding: 5px;
    width: 86px;border-radius: 6%">更改信息</a>
</form>


<!-- 将标题设置成用户的名字 -->
<script type="text/javascript">
document.title= $('p.username').attr('uname')+" 的主页";
</script>
<hr>
<!-- 展示最近的登录记录 -->
<c:if test="${empty logs }">
<h2 style="text-align: center;">还没有登录记录呢！</h2>
</c:if>
<c:if test="${not empty logs }">
<div class="limiter">
	<div class="container-table100">
		<div class="wrap-table100">
			<div class="table">
				<div class="row header">
					<div class="cell"></div>
					<div class="cell">登录IP</div>
					<div class="cell">登录时间</div>
					<div class="cell">操作</div>
					<div class="cell">在线时间</div>
				</div>
				<c:forEach var="log" items="${logs }" varStatus="status">
				<div class="row">
					<div class="cell">${status.count }</div>
					<div class="cell">${log.ip }</div>
					<div class="cell">${log.logintime }</div>
					<div class="cell">${log.operate }</div>
					<div class="cell">${log.online_time }</div>
				</div>
				</c:forEach>
			</div>
		</div>
	</div>
</div>
</c:if>


</body>
</html>